package iterator;

import java.util.Iterator;

public class MainTest18 {
    public static void main(String[] args) {
        BookList bookList = new BookList();
        Book book1 = new Book("010203", "Java编程思想", 90);
        Book book2 = new Book("010204", "Java从入门到精通", 60);
        bookList.addBook(book1);
        bookList.addBook(book2);
//        while(bookList.hasNext()){
//            System.out.println(bookList.getNext());
//        }

        Iterator iter = bookList.iterator();
        while (iter.hasNext()) {
            Book book = (Book) iter.next();
            System.out.println(book);
        }
    }
}
